package fr.alma.trajectory.commons;

import java.util.ArrayList;
import java.util.List;

public class Square extends ASpaceObject implements SpaceObject {
	
	/**
	 * Le 4eme point
	 */
	private SpacePoint p4;
	
	public Square(SpacePoint p1, SpacePoint p2, SpacePoint p3, SpacePoint p4){
		super(p1, p2, p3);
		this.p4 = p4;
	}

	@Override
	public boolean isSquare(){
		return true;
	}
	
	@Override
	public List<SpacePoint> getSpacePoints(){
		List<SpacePoint> points = new ArrayList<SpacePoint>();
		points.add(getPoint1());
		points.add(getPoint2());
		points.add(getPoint3());
		points.add(p4);
		return points;
	}
	
	@Override
	public String toString(){
		return p1+""+p2+""+p3+""+p4;
	}


}
